
#pragma once

namespace IPCCall
{
	typedef unsigned char byte;
	typedef unsigned char uint8;
	typedef unsigned short uint16;
	typedef byte uint24[3];
	typedef unsigned int uint32;
	typedef unsigned long long uint64;
	typedef byte uint128[16];

	typedef char int8;
	typedef short int16;
	typedef int8 int24[3];
	typedef int int32;
	typedef long long int64;
	typedef int8 int128[16];
}

enum CONST_DESCRIPTION
{
	CONST_START																					=-0x3FFFFFFF,

	CONST_ZERO																					=0,

	CONST_END																					=0x3FFFFFFF
};

enum CONST_COMMON
{
	CONST_COMMON_START																			=-10,

	CONST_COMMON_FAIL																			=-1,
	CONST_COMMON_SUCCESS																		=0,


	CONST_COMMON_END																			=10
};

enum ERROR_COMMON
{
	ERROR_COMMON_START																			=-100,

	ERROR_COMMON_SHARED_PTR_NULL																=-101,
	ERROR_COMMON_PTR_NULL																		=-102,
	ERROR_COMMON_ASIO_UNEXPECTED_ERROR															=-103,
	ERROR_COMMON_CONTAINER_SIZE_ERROR															=-104,
	ERROR_COMMON_CONTAINER_ELEMENT_ALREADY_EXIST												=-105,
	ERROR_COMMON_CONTAINER_ELEMENT_NOT_EXIST													=-106,

	ERROR_COMMON_END																			=-200
};

enum INFO_COMMON
{
	INFO_COMMON_START																			=100,

	INFO_COMMON_TIMER_FIRE_EXCEPTION															=101,
	INFO_COMMON_ELEMENT_NOT_FOUND																=102,
	INFO_COMMON_CONTAINER_EMPTY																	=103,

	INFO_COMMON_END																				=200
};

enum INFO_BASE
{
	INFO_BASE_START																				=1000,

	INFO_PACKETELEMENT_READCONTAINERFROMBUFFER_BYTESTOREAD_EXCEED								=1011,
	INFO_BYTESTRANSFERRED_INADEQUATE															=1012,
	INFO_OPAQUE_READELEMENTSFROMOPAQUEDATA_OPAQUEDATA_EMPTY										=1013,

	INFO_BASE_END																				=2000
};

enum ERROR_BASE
{
	ERROR_BASE_START																			=-1000,

	ERROR_PACKETELEMENT_BYTES_COMPUTE															=-1018,
	ERROR_NUMERICVARARRAY_WRONG_LENGTH															=-1019,
	ERROR_STRUCTVARARRAY_WRONG_LENGTH															=-1020,
	ERROR_STRUCTVARLIST_WRONG_LENGTH															=-1021,

	ERROR_BASE_END																				=-2000
};

enum ERROR_IOBUFFER
{
	ERROR_IOBUFFER_START																		=-2000,


	ERROR_IOBUFFER_RECAPACITY_NOT_IN_WORKER_THREAD												=-2002,
	ERROR_IOBUFFER_CONSUME_SIZE_TOO_SMALL														=-2003,
	ERROR_IOBUFFER_PRODUCE_SPACE_TOO_SMALL														=-2004,
	ERROR_IOBUFFER_SEEK_WRONG_OFFSET															=-2005,
	ERROR_IOBUFFER_READ_SIZE_TOO_SMALL															=-2006,
	ERROR_IOBUFFER_PEEK_SIZE_TOO_SMALL															=-2007,
	ERROR_IOBUFFER_NTOHREAD_SIZE_TOO_SMALL														=-2008,
	ERROR_IOBUFFER_NTOHPEEK_SIZE_TOO_SMALL														=-2009,

	ERROR_IOBUFFER_END																			=-3000
};

enum INFO_PROTOCOL_RELOAD
{
	INFO_PROTOCOL_RELOAD_START																	=10000,

	INFO_PROTOCOL_RELOAD_IPADDRESSPORT_UNKNOWN_TYPE												=10001,
	INFO_PROTOCOL_RELOAD_DESTINATIONDATA_UNKNOWN_TYPE											=10002,
	INFO_PROTOCOL_RELOAD_SIGNERIDENTITYVALUE_UNKNOWN_TYPE										=10003,
	INFO_PROTOCOL_RELOAD_PROBEINFORMATIONDATA_UNKNOWN_TYPE										=10004,
	INFO_PROTOCOL_RELOAD_ICECANDIDATE_UNKNOWN_TYPE												=10005,
	INFO_PROTOCOL_RELOAD_CONFIGUPDATEREQ_UNKNOWN_TYPE											=10006,
	INFO_PROTOCOL_RELOAD_FRAMEDMESSAGE_UNKNOWN_TYPE												=10007,
	INFO_PROTOCOL_RELOAD_CHORDUPDATE_UNKNOWN_TYPE												=10008,
	INFO_PROTOCOL_RELOAD_CHORDLEAVEDATA_UNKNOWN_TYPE											=10009,
	INFO_PROTOCOL_RELOAD_FIXEDHEADER_TOO_SMALL													=10010,
	INFO_PROTOCOL_RELOAD_RELOADPACKET_FORMAT_ERROR												=10011,
	INFO_PROTOCOL_RELOAD_CHECKRELOADPACKETINTEGRITY_FAIL										=10012,
	INFO_PROTOCOL_RELOAD_MSG_SILENTLY_DROP														=10013,
	INFO_PROTOCOL_RELOAD_NODEID_INVALID															=10014,
	INFO_PROTOCOL_RELOAD_TRANSACTIONMGR_TRANSACTIONID_NOT_EXIST									=10015,
	INFO_PROTOCOL_RELOAD_TRANSACTIONMGR_TRANSACTIONOPERATION_IS_NULL							=10016,
	INFO_PROTOCOL_RELOAD_RELOADPACKET_WRONG_OVERLAY												=10017,
	//INFO_PROTOCOL_RELOAD_DESTINATION_IN_VIALIST_IS_NOT_NODEID									=10018,
	//INFO_PROTOCOL_RELOAD_VIALIST_IS_EMPTY														=10019,
	INFO_PROTOCOL_RELOAD_ATTACH_IN_PROGRESS														=10020,
	INFO_PROTOCOL_RELOAD_UNEXPECTED_ATTACHSTATUS												=10021,
	INFO_PROTOCOL_RELOAD_JOINING_FORBIDDEN														=10022,
	INFO_PROTOCOL_RELOAD_UNKNOWN_KIND															=10023,
	INFO_PROTOCOL_RELOAD_WRONG_DATAMODEL														=10024,
	INFO_PROTOCOL_RELOAD_TOO_MANY_ELEMENTS_FOR_DATAMODEL_SINGLE									=10025,
	INFO_PROTOCOL_RELOAD_DATA_TOO_OLD															=10026,
	INFO_PROTOCOL_RELOAD_KINDID_USED_TWICE_IN_STOREREQ											=10027,
	INFO_PROTOCOL_RELOAD_RESOURCEID_NOT_RESPONSIBLE												=10028,
	INFO_PROTOCOL_RELOAD_REPLICA_GENERATIONCOUNTER_ZERO_IN_STOREREQ								=10029,
	INFO_PROTOCOL_RELOAD_GENERATIONCOUNTER_NOT_EQUAL_IN_STOREREQ								=10030,
	INFO_PROTOCOL_RELOAD_DATA_TOO_LARGE															=10031,
	INFO_PROTOCOL_RELOAD_UNKNOWN_DATAMODEL_TYPE													=10041,
	INFO_PROTOCOL_RELOAD_UNKNOWN_KINDS															=10042,
	INFO_PROTOCOL_RELOAD_KINDID_USED_TWICE_IN_FETCHREQ											=10043,
	INFO_PROTOCOL_RELOAD_DICTIONARYKEY_USED_TWICE_IN_FETCHREQ									=10044,
	INFO_PROTOCOL_RELOAD_ILLEGAL_ARRAYRANGE_IN_FETCHREQ											=10045,
	INFO_PROTOCOL_RELOAD_ARRAYRANGE_OVERLAPED_IN_FETCHREQ										=10046,
	INFO_PROTOCOL_RELOAD_TRANSACTION_NOT_SUCCESS												=10047,
	INFO_PROTOCOL_RELOAD_CONNECTION_CLOSED														=10048,

	INFO_PROTOCOL_RELOAD_END																	=20000
};

enum ERROR_PROTOCOL_RELOAD
{
	ERROR_PROTOCOL_RELOAD_START																	=-10000,

	ERROR_PROTOCOL_RELOAD_UNKNOWN_IPADDRESS_TYPE												=-10001,
	ERROR_PROTOCOL_RELOAD_RELOADCONNECTIONACTOR_ONREAD_UNEXPECTED_ERROR							=-10002,
	ERROR_PROTOCOL_RELOAD_RELOADCONNECTIONACTOR_ONCONNECT_UNEXPECTED_ERROR						=-10003,
	ERROR_PROTOCOL_RELOAD_RELOADCONNECTIONACTOR_ONWRITE_UNEXPECTED_ERROR						=-10004,
	ERROR_PROTOCOL_RELOAD_PREPAREFORWARDINGHEADER_FAIL											=-10005,
	ERROR_PROTOCOL_RELOAD_NODEID_INVALID														=-10006,
	ERROR_PROTOCOL_RELOAD_IPADDRESS_INVALID														=-10007,
	ERROR_PROTOCOL_RELOAD_UNKNOWN_ATTACHSTATUS													=-10008,
	ERROR_PROTOCOL_RELOAD_NODEID_UNEQUAL														=-10009,
	ERROR_PROTOCOL_RELOAD_NODEID_NOT_IN_CONNECTION_TABLE										=-10010,
	ERROR_PROTOCOL_RELOAD_RELOADCONNECTIONACTOR_ONACCEPT_UNEXPECTED_ERROR						=-10011,
	ERROR_PROTOCOL_RELOAD_CANNOT_SEND_ATTACHREQ_TO_SELF											=-10012,
	ERROR_PROTOCOL_RELOAD_CANNOT_CONNECT_TO_SELF												=-10013,
	ERROR_PROTOCOL_RELOAD_NODEID_NOT_CONSISTENT													=-10014,

	ERROR_PROTOCOL_RELOAD_END																	=-20000
};
